<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>hello vue</title>
</head>

<body>
    <div id="app">
        <div>{{pmsg}}</div>
        <menu-item :title="ptitle" :content="pcontent"></menu-item>
        <menu-item :title="ptitle" content="pcontent"></menu-item>
    </div>

    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript">
        Vue.component('menu-item', {
            props: ['title', 'content'],
            data: function () {
                return {
                    msg: '子组件自身参数'
                }
            },
            template: '<div>{{msg + "-----" + title + "----" + content }}</div>'
        });
        var vm = new Vue({
            el: '#app',
            data: {
                pmsg: '来自父组件',
                ptitle: '父组件绑定属性',
                pcontent: '父组件'
            }
        });
    </script>
</body>

</html>